package com.joolun.web.api;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.joolun.common.core.domain.AjaxResult;
import com.joolun.common.utils.StringUtils;
import com.joolun.mall.entity.Active;
import com.joolun.mall.entity.Work;
import com.joolun.mall.service.ActiveService;
import com.joolun.mall.service.WorkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/active")
@Api(value = "active", tags = "活动")
public class ActiveApi {
    private final ActiveService baseService;


    @ApiOperation(value = "通过id查询实习")
    @GetMapping("/{id}")
    public AjaxResult getById(@PathVariable("id") String id){
        return AjaxResult.success(baseService.getById(id));
    }


    @ApiOperation(value = "分页查询实习")
    @GetMapping("/page")
    public AjaxResult getByPage(Page page, Active active ){
        System.out.println(page);
        System.out.println(active);
        IPage iPage = baseService.page1(page, active);
        return AjaxResult.success(iPage);
    }

}
